package com.cwm.test.builder;

public class Student {
    String name = null;
    int number = -1;
    String sex = null;

    public Student(Builder builder) {
        this.name = builder.name;
        this.number = builder.number;
        this.sex = builder.sex;
    }

    public static class Builder {
        String name = null;
        int number = -1;
        String sex = null;

        public Builder setName(String name) {
            this.name = name;
            return this;
        }

        public Builder setNumber(int number) {
            this.number = number;
            return this;
        }

        public Builder setSex(String sex) {
            this.sex = sex;
            return this;
        }

        public Student build() {
            return new Student(this);
        }
    }
}